/*
 * TestLua.cpp
 *
 *  Created on: 2012-4-9
 *      Author: chenjialiang
 */

#include "TestLua.h"

#include <LuaManager.h>
#include <Lunar.h>
#include <Log.h>

using namespace std;

using namespace Zha;

class TestClass
{
public:
	int count(lua_State *L) { return 1; }
	static const char className[];
	static Lunar<TestClass>::RegType methods[];
};

const char TestClass::className[] = "TestClass";
Lunar<TestClass>::RegType TestClass::methods[] =
{
  LUNAR_DECLARE_METHOD(TestClass, count),
  {0,0}
};

TestLua::TestLua()
{
	// TODO Auto-generated constructor stub

}

TestLua::~TestLua()
{
	// TODO Auto-generated destructor stub
}

void TestLua::main()
{
	//char path[] = "/home/zhazhaniu/workspace/zhalib/cpptest/luascript/testlua.lua";
	char path[] = "/home/chenjialiang/workspace/zhaLib/cpptest/luascript/testlua.lua";
	Zha::LuaManager lm(path);
	lm.NewGlobalTable("tttt");
	lm.SetIntToGlobalTable("tttt", "aa", 1);
	lm.SetStringToGlobalTable("tttt", "bb", "value");
	lm.CallFunc("testPrint", "");
}
